<template>
    <el-cascader placeholder="" :options="DepartList" @change="AddDepart()" v-model="projectDepartresult" style="width: 80%;" filterable></el-cascader>
</template>

<script>
export default {
    props:{
        projectDepartresult:String
    },
    data() {
        return{
            projectDepartresult:"",
            DepartList:[],
        }
    },
    created(){
        this.GetDepartList();
    },
    methods:{
        GetDepartList(){
            this.http.get("api/depart/DepartShow").then((res) => {
                console.log(res);
                this.DepartList = res;
            });
        },
        AddDepart(){
            this.$emit("AddDepart",this.projectDepartresult.toString())
            // alert(this.projectDepartresult.toString())
        }
    }
}
</script>